fix(powershell): stop Out-Null swallowing the AVAILABLE_DOCS status lines - #3891
Open
jawwad-ali wants to merge 1 commit into
Open
fix(powershell): stop Out-Null swallowing the AVAILABLE_DOCS status lines#3891jawwad-ali wants to merge 1 commit into
Out-Null swallowing the AVAILABLE_DOCS status lines#3891jawwad-ali wants to merge 1 commit into
Conversation
…ines
Test-FileExists / Test-DirHasFiles report their line with Write-Output and
ALSO return $true/$false — both on the Success stream. The callers piped
the whole call to `| Out-Null` to discard the boolean, which discarded the
report line with it, so text mode printed the header and nothing under it:
BEFORE (measured, powershell.exe -NoProfile -File ... -IncludeTasks):
FEATURE_DIR:...\specs\001-f
AVAILABLE_DOCS:
(2 lines)
AFTER:
FEATURE_DIR:...\specs\001-f
AVAILABLE_DOCS:
[OK] research.md
[FAIL] data-model.md
[FAIL] contracts/
[FAIL] quickstart.md
[FAIL] tasks.md
(7 lines)
The bash and Python twins both list every document under that header, so
the PowerShell variant silently returned less information for the same
inputs.
Filter out only the boolean, keeping the report lines. Adds the first
PowerShell text-mode test in this file (every existing PS test is -Json).
File stays ASCII-only (verified 0 non-ASCII bytes).
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
jawwad-ali
force-pushed
the
fix/ps-checkprereq-outnull
branch
from
July 31, 2026 08:20
59f5e38 to
6e52eb5
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Test-FileExistsandTest-DirHasFilesinscripts/powershell/common.ps1do two things on the Success stream — they write the report line and return a bool:check-prerequisites.ps1piped the whole call to| Out-Nullto throw away the boolean — which threw away the report line too.Reproduction on current
main(81bf741)powershell.exe -NoProfile -File .specify/scripts/powershell/check-prerequisites.ps1 -IncludeTasks, in a project withspecs/001-f/plan.mdandspecs/001-f/contracts/:AVAILABLE_DOCS:is emitted with nothing under it. The bash and Python twins list all five documents for the same inputs, so the PowerShell variant silently returns less information — and any agent parsing the doc list sees none.Fix
Drop only the boolean:
Measured after the fix, same project plus
research.md:No breaking change. JSON mode does not go through this path and is untouched. The booleans were already being discarded and are still discarded; the only difference is that the lines the helpers were writing now actually reach stdout. Exit codes unchanged.
The file stays ASCII-only — verified 0 non-ASCII bytes after the edit.
Verification
-Json, which is why the gap was never caught. It is gated on the file's existingHAS_PWSH or _WINDOWS_POWERSHELLguard.mainbaseline captured on81bf741(0 pre-existing in scope).uvx ruff@0.15.0 check src tests→ cleanNote this test file is also touched by my open #3785 and #3890, so expect a trivial append conflict depending on merge order — happy to rebase.
Written with assistance from Claude Code. Bug found, reproduced, and verified by me on current
mainwith realpowershell.exe.